﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:myControls="clr-namespace:Google_Plus.Controls"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:imageTools="clr-namespace:ImageTools.Controls;assembly=ImageTools.Controls" 
    xmlns:c4f="clr-namespace:Coding4Fun.Phone.Controls;assembly=Coding4Fun.Phone.Controls"
    xmlns:local="clr-namespace:Google_Plus.Types">

    <Style x:Key="RichHyperlinkButton" TargetType="HyperlinkButton">
        <Setter Property="VerticalAlignment" Value="Top"/>
        <Setter Property="HorizontalAlignment" Value="Left"/>
        <Setter Property="toolkit:TiltEffect.IsTiltEnabled" Value="True"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="HyperlinkButton">
                    <ContentPresenter Content="{TemplateBinding Content}"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ContentChatBubble" TargetType="c4f:ChatBubble">
        <Setter Property="HorizontalAlignment" Value="Left"/>
        <Setter Property="ChatBubbleDirection" Value="UpperLeft"/>
    </Style>

    <SolidColorBrush x:Key="HyperlinkBrush" Color="#FFA2A2FF"/>

    <Style TargetType="myControls:PostView">
        <Setter Property="Margin" Value="5 15 5 0"/>
        <Setter Property="Background" Value="{StaticResource PhoneBackgroundBrush}"/>
        <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="myControls:PostView">
                    <StackPanel CacheMode="BitmapCache">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="70" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <HyperlinkButton 
                                x:Name="AuthorPhotoLink"
                                Style="{StaticResource RichHyperlinkButton}">
                                <Image 
                                    x:Name="AuthorPhoto"
                                    Width="64" Height="64"/>
                            </HyperlinkButton>
                            <StackPanel Margin="0 -6 0 0" Grid.Column="1">
                                <HyperlinkButton
                                    x:Name="AuthorNameLink"
                                    Style="{StaticResource RichHyperlinkButton}">
                                    <TextBlock 
                                        x:Name="AuthorName" 
                                        FontSize="{StaticResource PhoneFontSizeMediumLarge}" 
                                        Foreground="{StaticResource HyperlinkBrush}" />
                                </HyperlinkButton>
                                <TextBlock x:Name="Information"/>
                                <c4f:ChatBubble 
                                    x:Name="ContentChatBubble"
                                    Visibility="Collapsed"
                                    Style="{StaticResource ContentChatBubble}">
                                    <toolkit:ContextMenuService.ContextMenu>
                                        <toolkit:ContextMenu>
                                            <toolkit:MenuItem
                                                Name="SelectAll"
                                                Header="SelectAll"/>
                                            <toolkit:MenuItem 
                                                Name="Copy"
                                                Header="Copy content"/>
                                        </toolkit:ContextMenu>
                                    </toolkit:ContextMenuService.ContextMenu>
                                </c4f:ChatBubble>
                            </StackPanel>
                        </Grid>
                        <Grid
                            x:Name="ShareBlock" 
                            Margin="20 5 0 0"
                            Visibility="Collapsed">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="55" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <HyperlinkButton
                                x:Name="OriginalAuthorPhotoLink"
                                Style="{StaticResource RichHyperlinkButton}">
                                <Image 
                                    x:Name="OriginalAuthorPhoto"
                                    Width="48" Height="48"/>
                            </HyperlinkButton>
                            <StackPanel Margin="0 -6 0 0" Grid.Column="1">
                                <toolkit:WrapPanel>
                                    <TextBlock Text="Originally shared by " Margin="0 2 0 0"/>
                                    <HyperlinkButton 
                                        x:Name="OriginalAuthorNameLink"
                                        Style="{StaticResource RichHyperlinkButton}">
                                        <TextBlock 
                                            x:Name="OriginalAuthorName"
                                            TextWrapping="Wrap"
                                            FontSize="{StaticResource PhoneFontSizeMedium}"
                                            Foreground="{StaticResource HyperlinkBrush}" />
                                    </HyperlinkButton>
                                </toolkit:WrapPanel>
                                <c4f:ChatBubble
                                    x:Name="OriginalContentChatBubble"
                                    Style="{StaticResource ContentChatBubble}"
                                    Visibility="Collapsed">
                                    <toolkit:ContextMenuService.ContextMenu>
                                        <toolkit:ContextMenu>
                                            <toolkit:MenuItem
                                                Name="SelectAllOriginal"
                                                Header="SelectAll"/>
                                            <toolkit:MenuItem 
                                                Name="CopyOriginal"
                                                Header="Copy content"/>
                                        </toolkit:ContextMenu>
                                    </toolkit:ContextMenuService.ContextMenu>
                                </c4f:ChatBubble>
                            </StackPanel>
                        </Grid>
                        <HyperlinkButton
                            x:Name="Link"
                            Style="{StaticResource RichHyperlinkButton}"
                            Margin="0 5 0 0"
                            Visibility="Collapsed">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition MaxWidth="24"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <Image 
                                    x:Name="Icon"
                                    VerticalAlignment="Top"
                                    MaxHeight="24" />
                                <TextBlock 
                                    x:Name="LineOne"
                                    Grid.Column="1"
                                    Margin="5 -5 0 0" 
                                    TextWrapping="Wrap"
                                    FontWeight="Bold"
                                    FontSize="{StaticResource PhoneFontSizeMedium}"
                                    Foreground="{StaticResource HyperlinkBrush}" />
                            </Grid>
                        </HyperlinkButton>
                        <TextBlock 
                            x:Name="LineTwo"
                            TextWrapping="Wrap" 
                            FontSize="{StaticResource PhoneFontSizeMedium}"/>
                        <local:LightBox
                            DataContext="{Binding Media.Images}" 
                            MaxHeight="450" />
                        <toolkit:WrapPanel 
                            x:Name="TagBlock"
                            Margin="0 5 0 0"
                            Visibility="Collapsed">
                            <TextBlock Text="Shared from the Google+ " />
                            <HyperlinkButton Style="{StaticResource RichHyperlinkButton}">
                                <TextBlock 
                                    x:Name="Tag"
                                    Foreground="{StaticResource HyperlinkBrush}" />
                            </HyperlinkButton>
                            <TextBlock Text=" stream"/>
                        </toolkit:WrapPanel>
                        <Grid Margin="0 5 0 0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="48"/>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="64"/>
                            </Grid.ColumnDefinitions>
                            <Button 
                                Name="PlusOne" 
                                BorderThickness="0" 
                                FontSize="{StaticResource PhoneFontSizeMedium}" 
                                Padding="10 5"/>
                            <Button
                                Name="Reshare" 
                                Grid.Column="1"
                                BorderThickness="0"
                                Padding="10 5">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="48" />
                                        <ColumnDefinition Width="Auto" />
                                    </Grid.ColumnDefinitions>
                                    <Image
                                        Height="48"
                                        Source="/Images/appbar.social.retweet.rest.png"/>
                                    <TextBlock 
                                        x:Name="ReshareCount"
                                        Grid.Column="1" 
                                        FontSize="{StaticResource PhoneFontSizeMedium}" 
                                        Margin="0 8 0 0"/>
                                </Grid>
                            </Button>
                            <Image 
                                Grid.Column="2" 
                                Height="48" 
                                Source="/Images/appbar.addcomment.rest.png"/>
                            <TextBlock 
                                Grid.Column="3"
                                x:Name="CommentCount"
                                Margin="0 25 0 0"
                                FontSize="{StaticResource PhoneFontSizeMedium}"
                                FontFamily="{StaticResource PhoneFontFamilySemiBold}" />
                            <Button 
                                Grid.Column="5" 
                                BorderThickness="0" 
                                Padding="0" 
                                Name="btnMenuSwitcher">
                                <Image 
                                    Height="48" 
                                    Stretch="UniformToFill" 
                                    Source="/Images/appbar.overflowdots.png"/>
                            </Button>
                        </Grid>
                        <ItemsControl 
                            Margin="20 5 0 0"
                            ItemsSource="{Binding Replies}">
                            <ItemsControl.ItemTemplate>
                                <DataTemplate>
                                    <myControls:CommentView/>
                                </DataTemplate>
                            </ItemsControl.ItemTemplate>
                        </ItemsControl>
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="myControls:CommentView">
        <Setter Property="Margin" Value="0 10 0 0"/>
        <Setter Property="Background" Value="{StaticResource PhoneBackgroundBrush}"/>
        <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="myControls:CommentView">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="55" />
                        </Grid.ColumnDefinitions>
                        <HyperlinkButton
                            Grid.Column="1"
                            x:Name="AuthorPhotoLink"
                            Style="{StaticResource RichHyperlinkButton}">
                            <Image
                                x:Name="AuthorPhoto"
                                Width="48" Height="48" />
                        </HyperlinkButton>
                        <StackPanel
                            Margin="0 -6 0 0">
                            <StackPanel
                                Orientation="Horizontal"
                                HorizontalAlignment="Right">
                                <TextBlock
                                    x:Name="PlusOneCount"
                                    VerticalAlignment="Bottom"
                                    Visibility="Collapsed"/>
                                <TextBlock 
                                    x:Name="Information"
                                    VerticalAlignment="Bottom"/>
                                <HyperlinkButton 
                                    x:Name="AuthorNameLink"
                                    Style="{StaticResource RichHyperlinkButton}">
                                    <TextBlock 
                                        x:Name="AuthorName"
                                        FontSize="{StaticResource PhoneFontSizeMedium}"
                                        Foreground="{StaticResource HyperlinkBrush}"/>
                                    <toolkit:ContextMenuService.ContextMenu>
                                        <toolkit:ContextMenu>
                                            <toolkit:MenuItem 
                                                Header="View profile" 
                                                FontWeight="Bold" 
                                                x:Name="menuViewProfile" />
                                            <toolkit:Separator
                                                Visibility="{Binding Converter={StaticResource BoolToVisibilityConverter}, Path=CanMention}"/>
                                            <toolkit:MenuItem 
                                                Header="Mention" 
                                                x:Name="menuMention" 
                                                Visibility="{Binding Converter={StaticResource BoolToVisibilityConverter}, Path=CanMention}"/>
                                        </toolkit:ContextMenu>
                                    </toolkit:ContextMenuService.ContextMenu>
                                </HyperlinkButton>
                            </StackPanel>
                            <c4f:ChatBubble 
                                x:Name="ContentChatBubble"
                                ChatBubbleDirection="UpperRight"
                                HorizontalAlignment="Right">
                                <toolkit:ContextMenuService.ContextMenu>
                                    <toolkit:ContextMenu>
                                        <toolkit:MenuItem
                                                Name="SelectAll"
                                                Header="SelectAll"/>
                                        <toolkit:MenuItem 
                                                Name="Copy"
                                                Header="Copy content"/>
                                    </toolkit:ContextMenu>
                                </toolkit:ContextMenuService.ContextMenu>
                            </c4f:ChatBubble>
                        </StackPanel>
                        <toolkit:ContextMenuService.ContextMenu>
                            <toolkit:ContextMenu>
                                <toolkit:MenuItem 
                                    Name="PlusOne"
                                    Header="+1 the comment"/>
                                <toolkit:Separator/>
                                <toolkit:MenuItem 
                                    Name="Report"
                                    Header="Report abuse"/>
                                <toolkit:MenuItem 
                                    Name="Edit"
                                    Header="Edit"
                                    Visibility="Collapsed"/>
                                <toolkit:MenuItem 
                                    Name="Delete"
                                    Header="Delete comment"
                                    Visibility="Collapsed"/>
                            </toolkit:ContextMenu>
                        </toolkit:ContextMenuService.ContextMenu>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>